package com.hhs.storage.controller;


import com.hhs.storage.bean.Notepad;
import com.hhs.storage.bean.ProjectWorkFlow;
import com.hhs.storage.bean.ResponseInfo;
import com.hhs.storage.bean.dto.WorkFlow;
import com.hhs.storage.service.ProjectWorkFlowService;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

import javax.annotation.Resource;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author hhs
 * @since 2023-02-10
 */
@RestController
@RequestMapping("/projectWorkFlow")
public class ProjectWorkFlowController {
    @Resource
    private ProjectWorkFlowService projectWorkFlowService;
    @RequestMapping("/getAllByProjectPlanId")
    public Map<String,Object> getAllByProjectPlanId(@RequestParam String projectPlanId){
        ProjectWorkFlow projectWorkFlow=new ProjectWorkFlow();
        projectWorkFlow.setProjectPlanId(projectPlanId);
        return projectWorkFlowService.getAll(projectWorkFlow);
    }
    @RequestMapping("/add")
    public Map<String,Object> add(@RequestParam  Integer step, @RequestParam String content,@RequestParam String projectPlanId){
        return projectWorkFlowService.add(step,content,projectPlanId);
    }
    @RequestMapping("/edit")
    public Map<String,Object> edit(@RequestParam Integer step,@RequestParam String content,@RequestParam String id){
        return projectWorkFlowService.edit(step,content,id);
    }
    @RequestMapping("/dele")
    public Map<String,Object> dele(String id){
        return projectWorkFlowService.dele(id);
    }
    @RequestMapping("/changeStatue")
    public Map<String,Object> changeStatue(String id,Integer status){
        return projectWorkFlowService.changeStatue(id,status);
    }

    //批量工序的修改
    @PostMapping(value = "wkEdit")
    public Map<String, Object> wkEdit(@RequestBody WorkFlow workFlow){
        return projectWorkFlowService.wkEdit(workFlow);
    }
    //工序的查询
    @PostMapping(value = "wkQuery")
    public Map<String, Object> wkQuery( WorkFlow workFlow){
        return projectWorkFlowService.wkQuery(workFlow);
    }


}

